# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=fclones
pkgver=0.26.0
pkgrel=0
pkgdesc="Efficient duplicate file finder"
url="https://github.com/pkolaczk/fclones"
license="MIT"
arch="all !s390x !riscv64" # blocked by rust/cargo
arch="$arch !armhf !armv7 !x86" # tests fail
makedepends="cargo eudev-dev"
source="https://github.com/pkolaczk/fclones/archive/v$pkgver/fclones-$pkgver.tar.gz
	musl-fix.patch
	"

export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
export CARGO_PROFILE_RELEASE_LTO="true"
export CARGO_PROFILE_RELEASE_PANIC="abort"

prepare() {
	default_prepare

	cargo fetch --locked
}

build() {
	cargo build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 target/release/fclones "$pkgdir"/usr/bin/fclones
}

sha512sums="
315274df59e420d61cf05a5dc287bcec65d203582e3d0e514305108d63ce4d91975fcc06e640ab4b8d6629bc1eb334f65f5270da443847c9855d03c0e443644c  fclones-0.26.0.tar.gz
bca0d44f67de1f16e2cbdccfe7fb5b0aea4cadf5912b548eaa584d3c40e32e1b8d81385a19dc48e2ef66143ac392c8538489c10c0f0fc60fb8f779446edc4d3a  musl-fix.patch
"
